package com.lanqiao.attendance.controller;

import com.lanqiao.attendance.service.UserService;
import com.lanqiao.attendance.vo.LoginParam;
import com.lanqiao.attendance.vo.RegisterParam;
import com.lanqiao.attendance.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: attendance
 * @description
 * @author: 刘 华
 * @create: 2022-07-08 18:47
 **/

@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserService userService;


    /**
     * 统一登录接口
     * @param loginParam
     * @return
     */
    @PostMapping("login")
    public Result login(@RequestBody LoginParam loginParam){
        System.out.println(loginParam);
        return userService.login(loginParam);
    }

    /**
     * 统一注册
     * @param registerParam
     * @return
     */

    @PostMapping("register")
    public Result register(@RequestBody RegisterParam registerParam){
        System.out.println(registerParam);
        return userService.register(registerParam);
    }



}
